using UnityEngine;
using UnityEditor;
using System.Collections;

[CustomEditor(typeof(Seed))]
public class SeedEditor : Editor
{
    Seed seed;

    public override void OnInspectorGUI()
    {
        seed = (Seed)target;

        seed.growDist = EditorGUILayout.FloatField("Grow Distance", seed.growDist);
        seed.maxDist = EditorGUILayout.FloatField("Max Distance", seed.maxDist);
        seed.minDist = EditorGUILayout.FloatField("Min Distance", seed.minDist);

        EditorGUILayout.Space();
        seed.attachCrowns = EditorGUILayout.Toggle("Limit growth to specific crowns", seed.attachCrowns);

        if (seed.attachCrowns)
        {
            DrawDefaultInspector();
        }

        EditorUtility.SetDirty(seed);
    }
}
